import request from '@/utils/request'

// Get查询
export function httpGet(url, params) {
  return request({
    url: url,
    method: 'get',
    params: params instanceof Object ? params : {params}
  })
}

/**
 * POST请求
 * @param {Object} url
 * @param {Object} data
 */
export function httpPost(url, data) {
  return request({
    url: url,
    method: 'post',
    data: data
  })
}

/**
 * Put请求
 * @param {Object} url
 * @param {Object} data
 */
export function httpPut(url, data) {
  return request({
    url: url,
    method: 'put',
    data: data
  })
}

/**
 * Delete请求
 * @param {Object} url
 * @param {Object} data
 */
export function httpDel(url, data) {
  return request({
    url: url,
    method: 'delete',
    data: data
  })
}

